#@Author: bjy @Date: 2019/4/26 11:08 @Version 1.0#
<template>
  <el-table :data="tableDataList" highlight-current-row @current-change="handleTableChange"
            border style="width: 98%;margin:10px 1%" height="500"
            v-loading="loadingBoolean"
            element-loading-text="拼命加载中"
            element-loading-spinner="el-icon-loading">
    <el-table-column sortable prop="giftnum" label="礼品编号" ></el-table-column>
    <el-table-column sortable prop="giftname" label="礼品名称" ></el-table-column>
    <el-table-column sortable prop="giftintegral" label="兑换所需积分"></el-table-column>
    <el-table-column
      prop="giftstatus"
      label="礼品状态"
      :filters="[{ text: '展示中', value: '展示中' }, { text: '已下架', value: '已下架' }]"
      :filter-method="filterTag"
      filter-placement="bottom-end">
      <template slot-scope="scope">
        <el-tag
          :type="scope.row.giftstatus === '展示中' ? 'primary' : 'success'"
          disable-transitions>{{scope.row.giftstatus}}</el-tag>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
    //  此处导入组件,格式,例如:import xxx名称 from "路径"
    export default{
        // 这里是name,记得填写
        name: 'giftTableList',
        props: ['tableDataList','loadingBoolean'],
        //  数据定义
        data () {
            return {}
        },
        // 页面方法
        methods: {
          filterTag(value, row) {
            return row.giftstatus === value;
          },
          handleTableChange(e){
            this.$emit('changeData',e)
          },
        },
        // 计算属性
        computed: {},
        // 侦听器
        watch: {},
        // 依赖注入
        components: {}
    }
</script>

<!-- 本地样式 -->
<style scoped>

</style>
